<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 封装函数处理 用户输入一个数 是否是任意两个数的积 如果是 返回这两项的索引，如果不是返回false
      function arr(num) {
        let arr = [1, 3, 8, 2, 9]
        for (let i = 0; i < arr.length; i++) {
          for (let j = i + 1; j < arr.length; j++) {
            if (num === arr[i] * arr[j]) {
              return [[i], [j]]
            }
          }
        }
      }
      let num = +prompt('请输入一个数字')
      console.log(arr(num));
    </script>
  </body>
</html>
